/**
 * describe:
 *
 * @author helloworldyu
 * @data 2018/1/3
 */
public class Main {
	public static void main(String[] args) {
		GuardStudent testSubject = new GuardStudent();

		EatStudent eatStudent = new EatStudent();
		SleepStudent sleepStudent = new SleepStudent();
		MovieStudent movieStudent = new MovieStudent();

		testSubject.addEvent(eatStudent,"stopEat");
		testSubject.addEvent(movieStudent,"stopMovie","张",2);
		testSubject.addEvent(sleepStudent,"stopSleep");

		//===============开始通知==============
		try {
			System.out.println("发现老师，通知其他同学");
			testSubject.notifyX();
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}